package  
{
	import flash.display.*;
	import flash.events.*;
	import iks.utils.geom.*;
	import vehicle.*;
	
	public final class PursueEvade extends Sprite 
	{
		
		public function PursueEvade() 
		{
			m_pursuer = new SteeredVehicle();
			m_pursuer.position = new Vector2D(200, 200);
			m_pursuer.edgeBehavior = Vehicle.BOUNCE;
			this.addChild(m_pursuer);
			
			m_evader = new SteeredVehicle();
			m_evader.position = new Vector2D(400, 300);
			m_evader.edgeBehavior = Vehicle.BOUNCE;
			this.addChild(m_evader);
			
			this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
		}
		
		private function onEnterFrameHandler(evt : Event) : void
		{
			m_pursuer.pursue(m_evader);
			m_evader.evade(m_pursuer);
			//m_pursuer.seek(m_evader.position.clone());
			//m_evader.flee(m_pursuer.position.clone());
			
			m_pursuer.update();
			m_evader.update();
		}
		
		private var m_pursuer	: SteeredVehicle = null;
		private var m_evader	: SteeredVehicle = null;
		
	}

}

































///////////////////////////////////////////////////////////////////////////////////////////////////
// end file